package dao

import (
	"context"
	"sale-admin/internal/dal"
	"sale-admin/internal/models"
)

type SaleInfoLogDetail struct{}

func (SaleInfoLogDetail) List(ctx context.Context, query *dal.Query, logID int64) (list []*models.MaSaleInfoLogDetail, count int64, err error) {
	d := query.MaSaleInfoLogDetail
	if logID == 0 {
		return
	}
	tx := d.WithContext(ctx)
	list, _ = tx.Where(d.LogID.Eq(logID)).Find()
	count, err = tx.Count()
	return
}
